<?php
namespace app\index\controller;
use think\Controller;

class Member extends Controller{
	public function _initialize(){
		if(!session('?username')){
			$this->redirect('Login/index');
		}
	}
	public function index(){
		$r = db('member')->where('username', session('username'))->find();
		$r1 = db('member_detail')->where('userid', $r['userid'])->find();
		$member = array_merge($r, $r1);
		$member['avator'] = getavatar($r['userid'], '90');
		$group = db('member_group')->where('groupid', $r['groupid'])->find();
		$cat = \think\Loader::action('Base/site');
        $catname = '会员中心';
        $seo = \think\Loader::action('Base/site');
        $seo['site_title'] = $catname.' - '.$seo['site_title'];
    	$this->assign('seo', $seo);
		$this->assign('member', $member);
		$this->assign('group', $group);
		return $this->fetch();
	}
	public function memberInfo(){

	}
	public function favorite(){

	}
	public function message(){

	}
	public function messageDetail(){

	}
	public function editInfo(){

	}
}